<?php
/*
* Author: mma 
* Date: 2013-12-05 
*
* This is ach pds (deposit) file model. currently, only support canada domestic transfer and CAD currency. Please check default_*** function for default value.
*
* Header and trailor are the same as pad file. Only payment record is different
*/

include('ach_pad.php');

class ach_dom_pds extends ach_dom_pad {
    // override parent
    public function default_record($rec){
        $fields = $rec->getFields();
        $fields[1]->setValue('C');
        $fields[2]->setValue('200');
        $fields[3]->setValue('7079320000');
        $fields[4]->setValue(' ');
        $fields[6]->setValue(utilities::getPN());
        $fields[10]->setValue(' ');
        $fields[12]->setValue(' ');
        $fields[15]->setValue('E');
        $fields[16]->setValue(' ');
        $fields[17]->setValue('Cash2u deposit');
        $fields[18]->setValue('CAD');
        $fields[19]->setValue(' ');
        $fields[20]->setValue('CAN');
        $fields[21]->setValue(' ');
        $fields[22]->setValue(' ');
        $fields[23]->setValue('N');
    }

    // set default value for header. needs to be called after init
    public function default_header(){
        $fields = $this->header->getFields();
        $fields[1]->setValue('A');
        $fields[2]->setValue('HDR');
        // local account number from express
        $fields[3]->setValue('7079320000');
        $fields[4]->setValue('7873450 CANADA INC');
        $fields[5]->setValue(utilities::getFCN());
        $fields[6]->setValue(utilities::getJD());		
        $fields[7]->setValue('CAD');
        $fields[8]->setValue('1');
        $fields[9]->setValue(' ');
        $fields[10]->setValue(' ');
        $fields[11]->setValue(' ');
        $fields[12]->setValue(' ');
        $fields[13]->setValue(' ');
        $fields[14]->setValue(' ');
        $fields[15]->setValue(' ');
    }
	
    // set default value for trailor. needs to be called after init
    public function default_trailor(){
        $fields = $this->trailor->getFields();
        $fields[1]->setValue('Z');
        $fields[2]->setValue('TRL');
        $fields[3]->setValue('7079320000');
        $fields[6]->setValue('0');
        $fields[7]->setValue('0');
        $fields[8]->setValue('0');
        $fields[9]->setValue('0');
        $fields[10]->setValue(' ');
        $fields[11]->setValue(' ');
        $fields[12]->setValue(' ');
        $fields[13]->setValue(' ');
        $fields[14]->setValue(' ');
    }
	
}
?>